package com.quarkus.resource;

import com.quarkus.bean.Service;
import io.quarkus.arc.runtime.BeanContainer;

import javax.enterprise.inject.Instance;
import javax.inject.Inject;
import javax.ws.rs.GET;
import javax.ws.rs.Path;

/**
 * @version v1.0
 * @Description: 测试多个相同类型的bean怎么注入
 * @Author: TongRui乀
 * @Date: 2020/12/20 2:04 下午
 */
@Path("")
public class MultiSameBeanTest {

    @Inject
    Service service;

//    @Inject
//    Instance<Service> services;

//    @GET
//    @Path("/single")
//    public String hello(){
//        services.forEach(service -> {
//            System.out.println(service.hello());
//        });
//        return "service.hello()";
//    }

    @GET
    @Path("/single")
    public String hello(){
        System.out.println("call before");
        return service.hello();
    }

    @GET
    public String hello2(){
        return "hello";
    }
}
